Release 10.1A: OpenEdge Data Management:
DataServer for ORACLE
Sequence generator
A sequence generator is a database object that provides incremental values within any integer range. You can specify any positive or negative increment. The DataServer supports the ORACLE sequence generator. To define ORACLE sequences, you use the SQL
CREATESEQUENCEstatement and indicate the name, minimum and maximum values, increment, and whether numbers are reused. For example, this is the code for creating a sequence namedseq-table-namethat starts with 1 and increments by 1:
Note: Do not define ORACLE sequences with names ending in
_SEQunless this manual instructs you to do so. The DataServer uses ORACLE sequences whose names end in_SEQfor internal purposes.Table 2–3 compares the features of the OpenEdge and ORACLE sequence generators. An application that relies on sequence generators can access an OpenEdge database and, through the DataServer, an ORACLE database. See the chapter on database access in OpenEdge Development: Progress 4GL Handbook for information on defining and using OpenEdge sequences in your database applications.
If you add a sequence to a table in your supporting ORACLE database, you must update the schema image to reflect this addition. See Chapter 7, "The Data Server Tutorial," for instructions on updating a schema image.
There are two Progress 4GL functions that provide information about database sequences,
NEXT-VALUEandCURRENT-VALUE. When you use the DataServer, you can use these functions to get information about sequences in your ORACLE database, but you must use theNEXT-VALUEfunction first in the same session you use theCURRENT-VALUEfunction.
|
Copyright © 2005 Progress Software Corporation www.progress.com Voice: (781) 280-4000 Fax: (781) 280-4095 |